package com.example.concurrentprogramming8016.future.forkjoin.arraysum;

import java.util.concurrent.Callable;

/**
 * @author liyanhao
 * @Date 2023-01-08 0:02
 */
public class SunTask implements Callable<Long> {

    int[] arr;
    int start;
    int end;

    public SunTask(int[] arr, int start, int end) {
        this.arr = arr;
        this.start = start;
        this.end = end;
    }

    @Override
    public Long call() throws Exception {
        return SumUtils.arrSum(arr, start, end);
    }
}
